package com.unipay.easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @Project: yitong_parent
 * @Author: C.yu
 * @Time: 2023-04-02 11:08:10
 * @Desc: TODO 监听器
 */

public class ExcelListener extends AnalysisEventListener<UserData> {

    // 一行一行读取内容，从第二行开始
    @Override
    public void invoke(UserData userData, AnalysisContext analysisContext) {
        System.out.println(userData);
    }

    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        //super.invokeHeadMap(headMap, context);
        System.out.println("head: " + headMap);
        System.out.println("AnalysisContext - head : " + context);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("doAfterAllAnalysed: " + analysisContext);
    }
}
